import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkDongtaiPinglunVO, SkDongtaiPinglunForm, SkDongtaiPinglunQuery } from '@/api/app/SkDongtaiPinglun/types';

/**
 * 查询动态评论信息列表
 * @param query
 * @returns {*}
 */

export const listSkDongtaiPinglun = (query?: SkDongtaiPinglunQuery): AxiosPromise<SkDongtaiPinglunVO[]> => {
  return request({
    url: '/app/SkDongtaiPinglun/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询动态评论信息详细
 * @param id
 */
export const getSkDongtaiPinglun = (id: string | number): AxiosPromise<SkDongtaiPinglunVO> => {
  return request({
    url: '/app/SkDongtaiPinglun/' + id,
    method: 'get'
  });
};

/**
 * 新增动态评论信息
 * @param data
 */
export const addSkDongtaiPinglun = (data: SkDongtaiPinglunForm) => {
  return request({
    url: '/app/SkDongtaiPinglun',
    method: 'post',
    data: data
  });
};

/**
 * 修改动态评论信息
 * @param data
 */
export const updateSkDongtaiPinglun = (data: SkDongtaiPinglunForm) => {
  return request({
    url: '/app/SkDongtaiPinglun',
    method: 'put',
    data: data
  });
};

/**
 * 删除动态评论信息
 * @param id
 */
export const delSkDongtaiPinglun = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkDongtaiPinglun/' + id,
    method: 'delete'
  });
};
